var Max = function (s){
  var i =0, j =0,max =1;
  for(;j<=s.length;j++){
    if(s[i]!==s[j]){
      var count = j-i;
      if(count>max){max = count};
      i = j ;
    }
  }
  return max

}
var res = Max("abbcccc")
console.log(res)